<%# locals: (similar:) -%>
<ol class="similar">
  <% similar.each do |story| %>
    <li>
      <a href="<%= story.url %>" target="_blank"><%= story.title %></a>
      <% if story.merged_story_id %>
        (merged into <a href="<%= story.merged_into_story.url %>" target="_blank"><%= story.merged_into_story.title %></a>)
      <% end %>
      <%= story.user_is_author? ? "authored by" : "via" %>
      <%= styled_user_link story.user, story %>
      <%= how_long_ago_label(story.created_at) %>
      <span>
        |
        <%= story.show_score_to_user?(@user) ? "#{story.score} point".pluralize(story.score) : '~' %>
      </span>
      <span class="comments_label">
        |
        <a href="<%= Routes.title_path story %>">
          <% if story.comments_count == 0 %>
            no comments
          <% else %>
            <%= story.comments_count %> <%= 'comment'.pluralize(story.comments_count) %>
          <% end %>
        </a>
      </span>
    </li>
  <% end %>
</ol>
